/**
 * ...
 * @author Thot
 */

function AddAnimationCommand(){}; 
POO.extend( AddAnimationCommand, Command );



AddAnimationCommand.prototype.execute = function( p_notificationType, p_data )
{
	
	var facade = ApplicationFacade.getInstance(); 
	
	var appProxy = facade.getProxy( ApplicationProxy.NAME );
	var mapProxy = facade.getProxy( MapProxy.NAME );
	var animProxy = facade.getProxy( AnimationProxy.NAME );
	
	var currentMap = appProxy.currentMap;
	var currentLayer = appProxy.currentLayer;
	
	var mapVO = mapProxy.getMapVOById( currentMap );
	
	if( mapVO == null )
		return;
	
	var layerVO = mapVO.getLayerVOById( currentLayer );
	
	if( layerVO == null )
		return;
	
	var animVO = animProxy.getAnimationVOById(p_data.animId);
	
	if( animVO == null )
		return;
	
	//p_data.layerId
	//x,y,z,width,height,alpha,animated:true||false,texId||animId,movable:true||false
	layerVO.displayList.push(
	
				[p_data.x, p_data.y, 0, animVO.width, animVO.height, 1, true, p_data.animId, true ]
				
	);
	
};